<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>play</title>
    <link rel="icon" href="data:;base64,=">
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
    <script src="https://www.ckplayer.com/public/static/ckplayer-x3/js/ckplayer.js"></script>
    <link rel="stylesheet" type="text/css" href="https://www.ckplayer.com/public/static/ckplayer-x3/css/ckplayer.css"/>
</head>
<body>
<div class="video" style="width: 100%; height: 500px;max-width: 800px;"></div>
<p>
    <button type="button" onclick="player.play()">播放</button>
    <button type="button" onclick="player.pause()">暂停</button>
    <button type="button" onclick="player.seek(20)">跳转</button>
    <button type="button" onclick="player.volume(0.6)">修改音量</button>
    <button type="button" onclick="player.muted()">静音</button>
    <button type="button" onclick="player.exitMuted()">恢复音量</button>
    <button type="button" onclick="player.full()">全屏</button>
</p>
<p id="state1"></p>
<p id="state2"></p>
</body>

<script>

    const queryString = window.location.search;
    const urlParams = new URLSearchParams(queryString);
    const videoObj = urlParams.get('video');
    const baseUrl = "http://127.0.0.1:8888/api/file/videoPlay"

    let videoObject = {
        container: '.video', // 视频容器的ID
        volume: 0.8, // 默认音量，范围0-1
        video: baseUrl + '?video=' + videoObj, // 视频地址
    };

    console.log("video请求参数:" + JSON.stringify(videoObject))
    let player = new ckplayer(videoObject) // 调用播放器并赋值给变量player
</script>
</html>
